import { BaseTableState } from '#/core'
import {
  InsertMenuReq,
  MenuItem,
  MenuLevel,
} from '@/api/userCenter/system/model/menuModel'

export enum BtnPerm {
  ADD = 'uc-system-menc-add',
  EDIT = 'uc-system-menc-edit',
  DELETE = 'uc-system-menc-delete',
}

export interface FormStateWrapper {
  menuName: string
  menuState: boolean
}

export interface EditDialogFormState extends InsertMenuReq {
  enabled: boolean
  id: string
}

export type TableStateWrapper = BaseTableState<MenuItem>

export type MenuTypeMap = { [key in MenuLevel]: string }

export type OperateAction = 'add' | 'edit'

export interface EditDialogState {
  visible: boolean
  title: string
  action: OperateAction
  formState: EditDialogFormState
}
